import time


def time_consumed(fn):
    def calculate():
        start = time.time()
        fn()
        end = time. time()
        print('It took',end - start,'seconds to finish main()')
    return calculate
@ time_consumed
def main():
    time.sleep(1)
    print('whatever')
main()

